<template>
  <!-- :wrapperStyle="{ width: '33.3%', height: '170px' }" -->
  <BorderBox
    :title="title"
    :headerBottom="false"
    :wrapperStyle="{
      width: 'calc((100% - 32px) / 3)',
      height: '170px',
    }"
    :styleText="{ height: '75%' }"
  >
    <template #main_info>
      <div class="flex" style="height: 100%">
        <div class="main_info_l flex_center">
          <p>22.22%</p>
          <p class="used">最近2小时平均使用率</p>
        </div>
        <div class="main_info_r">
          <Charts id="vmCpuChartId" :options="lineOption" width="100%" height="100%" />
        </div>
      </div>
    </template>
  </BorderBox>
</template>

<script setup>
import { ref } from "vue";
import Charts from "@/components/Charts/index.vue";
import { lineEcharts } from "@/hooks/echarts-config.js";

defineProps({
  title: {
    type: String,
    default: "",
  },
});
const xAxis = ref(["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", "Fri", "Sat", "Sun"]);
const chartsData = ref([820, 932, 901, 934, 1290, 1330, 1320, 934, 1290, 1330]);
const lineOption = ref(lineEcharts(xAxis.value, chartsData.value));
</script>

<style lang="scss" scoped>
.main_info_l {
  font-size: 18px;
  width: 160px;
  flex-direction: column;
  align-items: self-start;
  .used {
    font-size: 12px;
    color: #2c406899;
    padding-top: 6px;
  }
}
.main_info_r {
  width: 100%;
  // border: 1px solid #000;
}
</style>
